using B.S.NewMedical.ErrorCode;
using MediatR;

namespace B.S.NewMedical.Api.Write.Application.Command.User
{
    /// <summary>
    /// 获取用户列表命令
    /// </summary>
    public class GetUserListCommand : IRequest<ApiResult<List<UserDto>>>
    {
        /// <summary>
        /// 搜索关键词
        /// </summary>
        public string? SearchKeyword { get; set; }

        /// <summary>
        /// 用户类型
        /// </summary>
        public string? UserType { get; set; }
    }

    /// <summary>
    /// 用户DTO
    /// </summary>
    public class UserDto
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public int UserId { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        public required string Username { get; set; }

        /// <summary>
        /// 用户真实姓名
        /// </summary>
        public required string RealName { get; set; }

        /// <summary>
        /// 用户类型
        /// </summary>
        public int Type { get; set; }

        /// <summary>
        /// 用户类型名称
        /// </summary>
        public string UserType => Type switch
        {
            1 => "医生",
            2 => "护士",
            3 => "管理员",
            4 => "药房管理员",
            5 => "收费员",
            _ => "未知"
        };
    }
} 